var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
(function () {
    // function Test(constructor:any){
    // 	return class extends constructor {
    // 		constructor(...args){
    // 			super(...args)
    // 			this.abc = 1111
    // 		}
    // 	}
    // }
    // function Test2 (target: any, key: string): any {
    // 	target.aaa || (target.aaa = new Set());
    // 	target.aaa.add(key)
    // }
    // function Type (...types:Function[]): any {
    // 	return function(target: any, key: string){
    // 		target.bbb || (target.bbb = new Map());
    // 		target.bbb.set(key,types)
    // 	}
    // }
    function test2(b) {
        console.log("b", b);
        return function (fn, key, proto) {
            console.log("test2", fn, key, proto);
        };
    }
    function Test1(constructor) {
        // console.log("a",a)
        console.log('constructor.prototype', constructor.prototype);
        console.log('constructor.name', constructor.name);
        for (var method in constructor.prototype) {
            console.log(method);
        }
    }
    // 证明 方法装饰器先执行，类装饰器后执行。所以可以在类装饰器中，获知哪些方法使用了哪些装饰器。
    var A = /** @class */ (function () {
        function A() {
        }
        // @Test2
        // @Type(String,Number)
        // a?:string
        // @Test2
        // b?:string
        // constructor({a,b}:any){
        // 	this.a = a
        // 	this.b = b
        // }
        A.prototype.fn1 = function (a) {
            console.log("fn1", a);
        };
        A.prototype.fn2 = function (a) {
            console.log("fn2", a);
        };
        __decorate([
            test2(11)
        ], A.prototype, "fn1", null);
        A = __decorate([
            Test1
        ], A);
        return A;
    }());
    // var a = new A({a:"1231"})
    // var a = new A()
    // console.log("===a.prototype",a.constructor.prototype)
    // console.log("a=",a)
    // console.log("a.b=",a.b)
    // console.log("a.aaa",a.aaa)
})();
